﻿using Iesi.Collections.Generic;
using NHibernate.Validator.Constraints;
using TestBat.IModels.Domain;

namespace TestBat.Models.Domain
{
    public class Trainee : DomainEntity, ITrainee
    {
        public Trainee()
        {
            this.groups = new HashedSet<ITraineeGroup>();
        }

        [NotNullNotEmpty]
        [Length(255)]
        public virtual string Username
        {
            get;
            set;
        }

        [NotNullNotEmpty]
        [Length(255)]
        public virtual string Password
        {
            get;
            set;
        }

        [NotNull]
        public virtual ISet<ITraineeGroup> TraineeGroups
        {
            get { return groups; }
            private set { groups = value; }
            //set { groups = value; }
        }

        private ISet<ITraineeGroup> groups;
    }
}
